package com.springboot.springbootredis.mq.stream;

import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.ObjectRecord;
import org.springframework.data.redis.stream.StreamListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MessageConsumer implements StreamListener<String, ObjectRecord<String, Object>> {


    @Override
    public void onMessage(ObjectRecord<String, Object> message) {

        log.info("接收到消息：key:{}, value:{}", message.getStream(), message.getValue());


    }
}
